package com.stu.controller.admin;

import com.stu.Dto.JobInformationDTO;
import com.stu.pojo.Counsellor;
import com.stu.pojo.Emp;
import com.stu.pojo.PageBean;
import com.stu.result.Result;
import com.stu.serive.CounsellorManageService;
import com.stu.serive.JobInformationService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.*;

import java.time.LocalDate;
import java.util.List;

@Slf4j
@RestController("")
@RequestMapping("/admin")
public class CounsellorManageController {

    @Autowired
    private CounsellorManageService counsellorManageService;

    /**
     * 删除辅导员信息
     * @param ids
     * @return
     */
    @DeleteMapping("/counsellorManage")
    private Result deleteCounsellorManage(@RequestParam List<Integer> ids){
        counsellorManageService.deleteCounsellorManage(ids);
        return Result.success();
    }

    /**
     * 查询辅导员信息
     * @param page
     * @param pageSize
     * @param emp
     * @return
     */
    @GetMapping("/counsellorInformation")//分页查询操作
    public Result selectCounsellorInformation(@RequestParam(defaultValue = "1") Integer page,//@RequestParam 用于将指定的请求参数赋值给方法中的形参中
                         @RequestParam(defaultValue = "1") Integer pageSize,
                         @RequestBody Counsellor emp){
        //  PageBean 是一个专门用于分页查询的方法，传入指定的参数即可
        PageBean pageBean = counsellorManageService.selectCounsellorInformation(page, pageSize, emp);
        return Result.success(pageBean);
    }
}
